package cn.tedu._05mvcboot01.pojo.dto;

public class BMIControllerDTO {
    private double height;
    private double weight;

    @Override
    public String toString() {
        return "BMIControllerDTO{" +
                "height=" + height +
                ", weight=" + weight +
                '}';
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    public String bmi(){
        double a = weight/(height*height);
        if (a<18.5){
            return "偏瘦";
        }else if (a<24){
            return "正常";
        }else if (a<27){
            return "微胖";
        }else {
            return "该减肥了";
        }
    }



}
